package com.ruitu.health_1.mvp.model;

import com.ruitu.arad.api.RxUtil;
import com.ruitu.arad.base.BaseModel;
import com.ruitu.health_1.dao.http.APIRetrofit;
import com.ruitu.router_module.bean.BaseResult2;
import com.ruitu.router_module.bean.PageModel2;
import com.ruitu.router_module.bean.article.Article;
import com.ruitu.router_module.bean.article.ArticleInfo;

import io.reactivex.Observable;


public class ArticleModel {
    public static class ArticleM extends BaseModel {
        public Observable<BaseResult2<PageModel2<Article>>> getArticleList(int page, int size) {
            return APIRetrofit.getDefault().getArticleListPage(page, size)
                    .compose(RxUtil.<BaseResult2<PageModel2<Article>>>subIoObMain());
        }
    }

    public static class ArticleDetailsM extends BaseModel{
        public Observable<BaseResult2<ArticleInfo>> articleInfo(String id){
            return APIRetrofit.getDefault().articleInfo(id)
                    .compose(RxUtil.<BaseResult2<ArticleInfo>>subIoObMain());
        }
    }

}
